<div class="container">
    <div class="row">
        <div class="col-sm-6">
            <h2>
                <?php 
                    if(isset($_GET['id'])){
                        echo 'Panel edycji pracownika';
                    }else{
                        echo 'Panel dodawania pracownika';
                    }?>
            </h2>

            <?php $form = $this->beginWidget('CActiveForm', array('id' => 'register-client-form')); ?>
            <div class="form-group">
                <?php echo $form->labelEx($model, 'firstname'); ?>
                <?php echo $form->textField($model, 'firstname', array('class' => 'form-control')) ?>
                <?php echo $form->error($model, 'firstname') ?>
            </div>
            <div class="form-group">
                <?php echo $form->labelEx($model, 'lastname'); ?>
                <?php echo $form->textField($model, 'lastname', array('class' => 'form-control')) ?>
                <?php echo $form->error($model, 'lastname') ?>
            </div>
                <div class="form-group">
                    <?php echo $form->labelEx($model, 'login'); ?>
                    <?php echo $form->textField($model, 'login', array('class' => 'form-control')) ?>
                    <?php echo $form->error($model, 'login') ?>
                </div>
                <div class="form-group">
                    <?php if(!isset($_GET['id'])){ ?>
                    <?php echo $form->labelEx($model, 'pass_hash'); ?>
                    <?php echo $form->passwordField($model, 'pass_hash', array('class' => 'form-control')) ?>
                    <?php echo $form->error($model, 'pass_hash') ?>
                    <?php }?>
                </div>
            <div class="form-group">
                <?php echo $form->labelEx($model, 'role_id'); ?>
                <?php echo $form->dropDownList($model, 'role_id', array(1 => 'Administrator', 2 => 'Moderator'), array('class' => 'form-control')) ?>
                <?php echo $form->error($model, 'role_id') ?>
            </div>
            <?php 
            if(isset($_GET['id'])){
                echo CHtml::submitButton('Edytuj pracownika', array('class' => 'btn btn-success'));
            }else{
                echo CHtml::submitButton('Dodaj pracownika', array('class' => 'btn btn-success'));
            }?>
            <?php $this->endWidget(); ?>
        </div>
    </div>
</div>

